<template>
    <el-container>太长时间没登录，请重新登录!</el-container>
    <el-container v-if="count>0">{{count}}秒后自动跳转，也可以点击下方链接手动跳转</el-container>
    <el-link @click="jump">返回登录界面</el-link>
  </template>
  
  <script>
  export default {
    data() {
      return {
        count: 3
      }
    },
    created() {
      this.deleteToken()
    },
    methods: {
      jump(){
        this.$router.push({path: '/giteeLogin'});
      },
      deleteToken() {
        window.localStorage.removeItem("token");
        if(!this.timer){
            this.timer = setInterval(()=>{
            if(this.count > 0){
                this.count--;
            }else{
                this.show = true;
                clearInterval(this.timer);
                this.timer = null;
                //跳转的页面写在此处
                this.$router.push({path: '/giteeLogin'});
            }
          },1000)
        }
      }
    },
    mounted() {
      // 在其他方法或是生命周期中也可以调用方法
    }
  }
  
  
  
  
  </script>
  